﻿
%using System;
%using System.Linq;
%using System.Collections;
%using System.Collections.Generic;
%using NetFluid;
%using MongoDB.Driver.Builders;
%using Sito.Model;
%page inherit Index;



%override Body
<div class="content" style="background-color:{%rand_color()%};">
    <h1>Tickets</h1>
    <div>
        % IEnumerable<Bug> bugs = args(0);
        %if(bugs.Count()>0)
            <table style="border: 2px solid white;" cellpadding="2" cellspacing="0">
                <tr style="border: 2px solid white;">
                  <td style="border: 1px solid white;">ID</td>
                  <td style="border: 1px solid white;">Author</td>
                  <td style="border: 1px solid white;">Description </td>
                  <td style="border: 1px solid white;">Date </td>
                  <td style="border: 1px solid white;">Priority </td>
                  <td style="border: 1px solid white;">Status </td>
                  <td style="border: 1px solid white;">AssignedTo </td>
                </tr>
                % foreach(var k in bugs)
                  <tr style="border: 2px solid white;">
                    <td style="border: 1px solid white;">
                        <a href="/assistance/view?id={% k.Guid %}">
                            {% k.Guid %}
                        </a>
                    </td>
                    <td style="border: 1px solid white;">{% k.Author %}</td>
                    <td style="border: 1px solid white;">{% ( k.Description.Length<20 ? k.Description : k.Description.Substring(0,20) ) %}</td>
                    <td style="border: 1px solid white;">{% k.Date %}</td>
                    <td style="border: 1px solid white;">{% k.Priority %}</td>
                    <td style="border: 1px solid white;">{% k.Status %}</td>
                    <td style="border: 1px solid white;">{% k.AssignedTo %}</td>
                  </tr>
                % end foreach
              </table>
        %else
            <p>No open tickets</p>
        %end if
    </div>
    <br />
    <a href="/assistance/submit"><h2>Open a new ticket</h2></a>
</div>

%end override 